package com.hq.fxh.No3_TuiGuang.Adaoter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 大圣
 * @ClassName RGStaticsAdapter
 * @Description :
 * @Created 2016/10/25 0025
 * @Email qwqe601660957@163.com
 */
public class RGStaticsAdapter extends FragmentPagerAdapter {
    List<Fragment> fragments = new ArrayList<>();
    private List<String> list_Title;

    public RGStaticsAdapter(FragmentManager fm, List<Fragment> fragments, List<String> list_Title) {
        super(fm);
        this.fragments = fragments;
        this.list_Title = list_Title;
    }

    public RGStaticsAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public int getItemPosition(Object object) {
        return POSITION_NONE;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return  list_Title.get(position % list_Title.size());
    }
}
